﻿@namespace Maanfee.Dashboard.Views.Core
@using System.Diagnostics;

@*<MudContainer MaxWidth="MaxWidth.Large">*@
	<div class="mb-2">
		<CascadingValue Value="this" IsFixed>
			@ChildContent
		</CascadingValue>
	</div>
	@*<div class="docs-navigation-footer">
	<NavigationFooter Section=_section Previous="@_previous" Next="@_next" />
	</div>*@
@*</MudContainer>*@

@code {

	public event Action<Stopwatch> Rendered;
	private Stopwatch Stopwatch = Stopwatch.StartNew();

	[Parameter] 
	public RenderFragment ChildContent { get; set; }

	protected override void OnAfterRender(bool firstRender)
	{
		if (Stopwatch.IsRunning)
		{
			Stopwatch.Stop();
			Rendered?.Invoke(Stopwatch);
		}

		if (firstRender)
		{
			StateHasChanged();
		}
	}

}